home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / include / MotifApp / DialogCallbackData.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-17  |  1.9 KB  |  64 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //////////////////////////////////////////////////////////////////////////////
  3. //         This example code is from the book:
  4. //
  5. //           Object-Oriented Programming with C++ and OSF/Motif
  6. //         by
  7. //           Douglas Young
  8. //           Prentice Hall, 1992
  9. //           ISBN 0-13-630252-1    
  10. //
  11. //         Copyright 1991 by Prentice Hall
  12. //         All Rights Reserved
  13. //
  14. //  Permission to use, copy, modify, and distribute this software for 
  15. //  any purpose except publication and without fee is hereby granted, provided 
  16. //  that the above copyright notice appear in all copies of the software.
  17. ///////////////////////////////////////////////////////////////////////////////
  18. //////////////////////////////////////////////////////////////////////////////
  19.  
  20.  
  21. ////////////////////////////////////////////////////////////////
  22. // DialogCallbackData.h: Auxiliary class used by DialogManager
  23. //////////////////////////////////////////////////////////////
  24. #ifndef DIALOGCALLBACKDATA
  25. #define DIALOGCALLBACKDATA
  26.  
  27. class DialogManager;
  28.  
  29. typedef void (*DialogCallback)( void * );
  30.  
  31. class DialogCallbackData {
  32.  
  33.   private:
  34.     
  35.     DialogManager  *_dialogManager;
  36.     DialogCallback  _ok;
  37.     DialogCallback  _help;
  38.     DialogCallback  _cancel;
  39.     void           *_clientData;
  40.     
  41.   public:
  42.     
  43.     DialogCallbackData ( DialogManager *dialog, 
  44.             void          *clientData,
  45.             DialogCallback ok,
  46.             DialogCallback cancel,
  47.             DialogCallback help)
  48.     {
  49.     _dialogManager = dialog;
  50.     _ok            = ok;
  51.     _help          = help;
  52.     _cancel        = cancel;
  53.     _clientData    = clientData;
  54.     }
  55.     
  56.     DialogManager  *dialogManager() { return _dialogManager; }
  57.     DialogCallback  ok() { return _ok; }
  58.     DialogCallback  help() { return _help; }
  59.     DialogCallback  cancel() { return _cancel; }
  60.     void           *clientData() { return _clientData; }
  61. };
  62. #endif
  63.  
  64.